package com.yuanlai.quartz.job;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 *  这是一个样例Job
 * @author yuanlai
 *
 */
@DisallowConcurrentExecution
public class PrintJob extends QuartzJobBean{

	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		// TODO Auto-generated method stub
		SimpleDateFormat formator = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
		System.out.println("printJob,这是一个打印任务,输出当前时间："+formator.format(new Date()));		
	}

}
